<h4><%= header %></h4>
<form id="EditView" name="EditView" method="POST" onsubmit="return false;">
<input type="submit" style="display: none;" data-role="none">
<ul data-role="listview" data-theme="a">
<li data-role="list-divider"><%= helper.translate('LBL_NOTE_INFORMATION', 'Notes') %></li>
<li>
<label for="name"><%= helper.translate('LBL_NOTE_SUBJECT', 'Notes') %></label>				
<input type='text' name='name' 
id='name'
maxlength='255' 
value="<%= model.get('name') %>"      required      >
</li>
<li>
<label for="filename"><%= helper.translate('LBL_FILENAME', 'Notes') %></label>				
<div id="filename-file-countainer"
<%
if (model.get('filename')) {
print ('style="display: none"');
}
%>
>
<input type='file' name='filename' 
id='filename'
value="<%= model.get('filename') %>"          >
<input type="hidden" name="filename_name" id="filename_name" value="<%= model.get('filename') %>">
<input type="hidden" name="filename_remove" id="filename_remove">
</div>
<div id="filename-link-countainer"
<%
if (!model.get('filename')) {
print ('style="display: none"');
}
%>
>		
<a href="<%= App.sugarUrl + "index.php?entryPoint=download&id=" + model.get('id') + "&type=" + model.module %>"><%= model.get('filename') %></a>
<button type="button" onclick="filename_removeFunction();"><%= App.translate("LBL_REMOVE") %></button>
</div>
<script type="text/javascript">
	
	filename_removeFunction = function () {	
		$("#filename_remove").val('true');		
		$("#filename-file-countainer").show();
		$("#filename-link-countainer").hide();
	}
</script>
</li>
<li>
<label for="parent_name"><%= helper.translate('LBL_RELATED_TO', 'Notes') %></label>				
<div class="ui-grid-a">
<div class="ui-block-a">
<select 
name="parent_type" 
onchange="changeparent_type(); clearparent_type();"
id="parent_type">
<%= helper.getHtmlOptions(model.get('parent_type'), 'record_type_display_notes' ) %>
</select>
</div>
<div class="ui-block-b">
<input type="text" value="<%= model.get('parent_name') %>" name="parent_name" id="parent_name" autocomplete="off">
<div>
<ul id="parent_name-suggestions" data-role="listview" data-inset="true"></ul>
</div>
</div>
</div>
<input type="hidden" value="<%= model.get('parent_id') %>" name="parent_id" id="parent_id">
<script type="text/javascript">
	function clearparent_type(){
		$("#parent_id").val('');
		$("#parent_name").val('');
	}
	function changeparent_type() {
		$("#parent_name").autocomplete('parent_id', $("#parent_type").val());
	}
	changeparent_type();	
</script>
</li>
<li>
<label for="description"><%= helper.translate('LBL_DESCRIPTION', 'Notes') %></label>				
<textarea name='description'  tabindex="" ><%= model.get('description') %></textarea>
</li>
<li data-role="list-divider"><%= helper.translate('LBL_PANEL_ADVANCED', 'Notes') %></li>
<li>
<label for="assigned_user_name"><%= helper.translate('LBL_ASSIGNED_TO_NAME', 'Notes') %></label>				
<input  type="text" value="<%= model.get('assigned_user_name') %>" name="assigned_user_name" id="assigned_user_name" autocomplete="off">
<input type="hidden" value="<%= model.get('assigned_user_id') %>" name="assigned_user_id" id="assigned_user_id">
<div>
<ul id="assigned_user_name-suggestions" data-role="listview" data-inset="true"></ul>
</div>
<script type="text/javascript">
	$("#assigned_user_name").autocomplete('assigned_user_id', 'Users');
</script>
</li>
</ul>
</form>
